﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:cv="clr-namespace:WickedFlame.Util.Converters;assembly=VecDraw.Util"
                    xmlns:ctrl="clr-namespace:WickedFlame.VecDraw.Base.Controls;assembly=VecDraw.Base"
                    xmlns:core="clr-namespace:WickedFlame.Core;assembly=VecDraw.Core"
                    xmlns:c="clr-namespace:WickedFlame.Core.Tools;assembly=VecDraw.Core">

    <!--<ResourceDictionary>-->
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Resources/ToolDataTemplates.xaml" />
            <ResourceDictionary Source="/Resources/ControlTemplates.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    <!--</ResourceDictionary>-->
    
    <LinearGradientBrush x:Key="VerticalSpliterBrush" StartPoint="1,0" EndPoint="0,0">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="Transparent" Offset="0"/>
            <GradientStop Color="Gray" Offset="0.3"/>
            <GradientStop Color="WhiteSmoke" Offset="1"/>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <DataTemplate x:Key="normalTemplate">
        <StackPanel Background="Transparent" Orientation="Horizontal" Height="30">

            <StackPanel.Resources>
                <Image Source="/VecDraw.Resources;component/Images/VecDraw.ColorSwitch.SquareLong.png" x:Key="swatchimage"/>
                <Image Source="/VecDraw.Resources;component/Images/VecDraw.ColorSwitch.SquareLong.png" x:Key="swatchimage2"/>
                <cv:BrushToColorConverter x:Key="brushtocolor"/>
            </StackPanel.Resources>

            <Rectangle Width="1" Fill="{StaticResource VerticalSpliterBrush}" Stroke="Transparent" StrokeThickness="0" Margin="5,3,5,3"/>

            <Image SnapsToDevicePixels="True" ClipToBounds="True" Margin="2" Width="16" Height="16" Source="/VecDraw.Resources;component/Images/VecDraw.Icon.PaintBucket.png"/>

            <ctrl:ColorSelector Width="20" Height="20" SwatchImage="{StaticResource swatchimage}" DataContext="{x:Static c:ShapePropertySettings.Settings}" SelectedColor="{Binding Fill, Converter={StaticResource brushtocolor}}" />

            <Rectangle Width="1" Fill="{StaticResource VerticalSpliterBrush}" Stroke="Transparent" StrokeThickness="0" Margin="5,3,5,3"/>

            <Image SnapsToDevicePixels="True" ClipToBounds="True" Margin="2" Width="16" Height="16" Source="/VecDraw.Resources;component/Images/VecDraw.Icon.Pencil.png"/>

            <ctrl:ColorSelector Width="20" Height="20" SwatchImage="{StaticResource swatchimage2}" DataContext="{x:Static c:ShapePropertySettings.Settings}" SelectedColor="{Binding Stroke, Converter={StaticResource brushtocolor}}"/>

            <ComboBox Name="comboPintThicknes" Margin="4" MinWidth="40" ItemsSource="{Binding Source={x:Static c:ShapePropertySettings.Settings}, Path=StrokeThicknessCollection}" SelectedItem="{Binding Source={x:Static c:ShapePropertySettings.Settings}, Path=StrokeThickness}" IsEditable="True" FontSize="10"/>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="lineTemplate">
        <StackPanel Background="Transparent" Orientation="Horizontal" Height="30">

            <StackPanel.Resources>
                <Image Source="/VecDraw.Resources;component/Images/VecDraw.ColorSwitch.SquareLong.png" x:Key="swatchimage"/>
                <cv:BrushToColorConverter x:Key="brushtocolor"/>
            </StackPanel.Resources>

            <Rectangle Width="1" Fill="{StaticResource VerticalSpliterBrush}" Stroke="Transparent" StrokeThickness="0" Margin="5,3,5,3"/>

            <Image SnapsToDevicePixels="True" ClipToBounds="True" Margin="2" Width="16" Height="16" Source="/VecDraw.Resources;component/Images/VecDraw.Icon.Pencil.png"/>

            <ctrl:ColorSelector Width="20" Height="20" SwatchImage="{StaticResource swatchimage}" DataContext="{x:Static c:ShapePropertySettings.Settings}" SelectedColor="{Binding Stroke, Converter={StaticResource brushtocolor}}"/>

            <ComboBox Margin="4" MinWidth="40" ItemsSource="{Binding Source={x:Static c:ShapePropertySettings.Settings}, Path=StrokeThicknessCollection}" SelectedItem="{Binding Source={x:Static c:ShapePropertySettings.Settings}, Path=StrokeThickness}" IsEditable="True" FontSize="10"/>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="textTemplate">
        <StackPanel Background="Transparent" Orientation="Horizontal" Height="30">

            <StackPanel.Resources>
                <Image Source="/VecDraw.Resources;component/Images/VecDraw.ColorSwitch.SquareLong.png" x:Key="swatchimage"/>
                <cv:BrushToColorConverter x:Key="brushtocolor"/>
            </StackPanel.Resources>

            <Rectangle Width="1" Fill="{StaticResource VerticalSpliterBrush}" Stroke="Transparent" StrokeThickness="0" Margin="5,3,5,3"/>

            <Image SnapsToDevicePixels="True" ClipToBounds="True" Margin="2" Width="16" Height="16" Source="/VecDraw.Resources;component/Images/VecDraw.Icon.Pencil.png"/>

            <ctrl:ColorSelector Width="20" Height="20" SwatchImage="{StaticResource swatchimage}" DataContext="{x:Static c:ShapePropertySettings.Settings}" SelectedColor="{Binding Stroke, Converter={StaticResource brushtocolor}}"/>

            <Rectangle Width="1" Fill="{StaticResource VerticalSpliterBrush}" Stroke="Transparent" StrokeThickness="0" Margin="5,3,5,3"/>

            <ComboBox Margin="4" MinWidth="40" DataContext="{x:Static c:ShapePropertySettings.Settings}" ItemsSource="{Binding StrokeThicknessCollection}" SelectedItem="{Binding FontSize}" IsEditable="True" FontSize="10"/>

            <ComboBox IsSynchronizedWithCurrentItem="True" Margin="4" ItemsSource="{x:Static Fonts.SystemFontFamilies}" DataContext="{x:Static c:ShapePropertySettings.Settings}" SelectedItem="{Binding FontFamily}"/>

        </StackPanel>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:SelectionTool}">
        
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:TrackerSelectionTool}">
        
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:HardSelectionTool}">
        
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:RectangleTool}">
        <ContentPresenter ContentTemplate="{StaticResource normalTemplate}"/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:EllipseTool}">
        <ContentPresenter ContentTemplate="{StaticResource normalTemplate}"/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:PolygonTool}">
        <ContentPresenter ContentTemplate="{StaticResource normalTemplate}"/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:LineTool}">
        <ContentPresenter ContentTemplate="{StaticResource lineTemplate}"/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:SCurveTool}">
        <ContentPresenter ContentTemplate="{StaticResource normalTemplate}"/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:CurveTool}">
        <ContentPresenter ContentTemplate="{StaticResource normalTemplate}"/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:TextTool}">
        <ContentPresenter ContentTemplate="{StaticResource textTemplate}"/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type c:ColorPickerTool}">
        
    </DataTemplate>
    
</ResourceDictionary>